﻿using ETask.Api.Data;
using ETask.Api.Models;

namespace ETask.Api.Dtos
{
    public class ProjectTaskDto : BaseDto
    {
        /// <summary>
        /// 项目id
        /// </summary>
        public int ProjectId { get; set; }

        /// <summary>
        /// 任务描述
        /// </summary>
        public string Description { get; set; }

        /// <summary>
        /// 分配给的项目成员
        /// </summary>
        public int AssignedTo { get; set; }

        public string AssignedToName { get; set; }

        /// <summary>
        /// 开始日期
        /// </summary>
        public DateTime BeginDate { get; set; }

        /// <summary>
        /// 截至日期
        /// </summary>
        public DateTime DueDate { get; set; }

        /// <summary>
        /// 任务状态 0 进行中 1 已完成
        /// </summary>
        public int Status { get; set; }

        /// <summary>
        /// 实际完成时间
        /// </summary>
        public DateTime? ActualEndDate { get; set; }
    }

    public class CreateProjectTaskDto
    {
        /// <summary>
        /// 项目id
        /// </summary>
        public int ProjectId { get; set; }

        /// <summary>
        /// 任务描述
        /// </summary>
        public string Description { get; set; }

        /// <summary>
        /// 分配给的项目成员
        /// </summary>
        public int AssignedTo { get; set; }

        /// <summary>
        /// 开始日期
        /// </summary>
        public DateTime BeginDate { get; set; }

        /// <summary>
        /// 截至日期
        /// </summary>
        public DateTime DueDate { get; set; }
    }

    public class UpdateProjectTaskDto
    {
        public int Id { get; set; }
        
        /// <summary>
        /// 任务描述
        /// </summary>
        public string Description { get; set; }

        /// <summary>
        /// 分配给的项目成员
        /// </summary>
        public int AssignedTo { get; set; }

        /// <summary>
        /// 开始日期
        /// </summary>
        public DateTime BeginDate { get; set; }

        /// <summary>
        /// 截至日期
        /// </summary>
        public DateTime DueDate { get; set; }

        /// <summary>
        /// 任务状态 0 进行中 1 已完成
        /// </summary>
        public int Status { get; set; }
    }


    public class ProjectTaskListParams
    {
        public int ProjectId { get; set; }

        public string? KeyWord { get; set; }

        /// <summary>
        /// 空 全部 0 进行中 1已完成
        /// </summary>
        public int? Status { get; set; }

        public DateTime? BeginTime { get; set; }

        public DateTime? EndTime { get; set; }


        public DateTime? DueBeginTime { get; set; }

        public DateTime? DueEndTime { get; set; }

        public PaginationParameters PageDto { get; set; }

        public bool IsMy { get; set; }
    }
}
